﻿/**
   ActionScript Class File -- Created with SAPIEN Technologies PrimalScript 3.1
   
   @class  
   @package
   @author Colin Leung
   @codehint 
   @example 
   @tooltip 
*/


class com.mixmedia.control.BtnArrow extends MovieClip{
	private var arrowType;
	private var pressing:Boolean;
	private var scroller;
	
	private var skip=5;
	private var _enable : Boolean=false;
	
	public function BtnArrow(){
		arrowType = (_name == 'mcUpArrow')?"up":"down";
	}
	
	public function set enable(arg:Boolean){
		_enable = arg;
		_alpha = _enable?100:10;
	}

	public function get enable():Boolean{
		return _enable;
	}

	private function onRollOver(){
	    pressing = true;
	}
	
	private function onRollOut(){
	    pressing = false;
	}
	
	private function onPress(){
		pressing = true;
	}
	
	private function onRelease(){
		pressing = false;
	}

	public function onDragOut(){
		onRelease();
	}

	private function onEnterFrame(){
	    if (pressing == true){
	    	if(arrowType=='up'){
				_parent.index-=5;
	        }else{
				_parent.index+=5;
	        }
	    }
	}

}
